import 'package:app/util/http.dart';
import 'package:flutter/material.dart';

class FlowProcessApi {
  BuildContext? context;

  static FlowProcessApi of(BuildContext? context) {
    FlowProcessApi flowProcessApi = FlowProcessApi();
    flowProcessApi.context = context;
    return flowProcessApi;
  }

  /// 查询物料流向信息
  Future<dynamic> materialFlow(code) async {
    return await ApiService.of(context).get("lgs/flow/materialFlow/" + code);
  }

  /// 通过任务号进行直投处理
  Future<dynamic> directPut(data) async {
    return await ApiService.of(context).put("lgs/flow/save", data);
  }

  /// 暂存物料
  Future<dynamic> stash(data) async {
    return await ApiService.of(context).post("lgs/flow/stash", data);
  }

  /// 报工周转处理
  Future<dynamic> takeOver(data) async {
    return await ApiService.of(context).post("lgs/flow/takeOver", data);
  }

}
